Skip to content

Conversation

@jansitarski
Copy link

@jansitarski jansitarski commented Sep 10, 2025

This PR upgrades all dependencies to ensure Python 3.13 compatibility and addresses critical security vulnerabilities from Python 3.10.

🚨 Security Motivation

This update addresses the following Critical and High CVEs:

image

📋 Key Changes

🐍 Core Python 3.13 Compatibility Fixes

Package Before After Reason
pandas 2.2.1 2.2.3 Fixes Cython compilation errors with Python 3.13
psycopg2-binary 2.9.9 2.9.10 Adds Python 3.13 pre-built wheels
asyncpg 0.29.0 0.30.0 Removes deprecated Python 3.13 API usage

🔗 Dependency Resolution & Numpy 2.x Support

Package Before After Reason
langchain-mongodb 0.2.0 >=0.4.0 Resolves numpy<2.0.0 conflict
langchain-aws 0.2.1 0.2.31 Adds numpy 2.x compatibility
boto3 1.34.144 1.39.7 Security updates and numpy 2.x support

📦 Package Migration & Security Updates

Package Before After Reason
rapidocr-onnxruntime 1.2.3 Removed Deprecated, no Python 3.13 support
onnxruntime - 1.20.1 Modern replacement with active maintenance
rapidocr - 2.0.6 Actively maintained OCR package
pydantic 2.9.2 2.10.0 Security fixes and performance improvements

🎯 Explicit Numpy Requirement

Added: numpy>=2.1.0

Why numpy was added explicitly:
To ensure langchain-community dependency resolution works correctly with Python 3.13.

🧪 Testing Updates

Updated test_requirements.txt:

  • Removed: pytest-postgresql==7.0.1 (caused import errors, tests are mocked)

@mondo192
Copy link

@danny-avila Any updates on this?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the codebase from Python 3.10 to Python 3.13.7 to address critical security vulnerabilities and ensure compatibility with the latest Python version. The update includes dependency version bumps across the board, with particular focus on packages that require Python 3.13 support (pandas, psycopg2-binary, asyncpg) and numpy 2.x compatibility (langchain-mongodb, langchain-aws, boto3).

Key changes:

  • Upgraded Python from 3.10 to 3.13.7 in production Dockerfiles and CI workflow
  • Updated 15+ dependencies for Python 3.13 compatibility and numpy 2.x support
  • Migrated from deprecated rapidocr-onnxruntime to modern onnxruntime + rapidocr packages
  • Added explicit numpy==2.1.0 dependency for langchain-community resolution
  • Removed problematic pytest-postgresql test dependency (tests are mocked)
  • Updated httpx test dependency to 0.28.1 for FastAPI TestClient compatibility

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
requirements.txt Updated 12 package versions for Python 3.13 compatibility, numpy 2.x support, and security patches; migrated OCR packages; added explicit numpy dependency
requirements.lite.txt Mirror of requirements.txt changes for lite deployment variant
Dockerfile Updated base image from python:3.10 to python:3.13.7
Dockerfile.lite Updated base image from python:3.10-slim to python:3.13.7-slim
.github/workflows/ci.yml Updated CI Python version from 3.12 to 3.13.7 for testing
test_requirements.txt Removed pytest-postgresql (causing import errors with mocked tests); updated httpx from 0.27.0 to 0.28.1

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

uses: actions/setup-python@v4
with:
python-version: '3.12'
python-version: '3.13.7'
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The devcontainer configuration was not updated to Python 3.13.7. The .devcontainer/Dockerfile specifies PYTHON_VERSION=3.10 (line 4) and .devcontainer/devcontainer.json has "PYTHON_VERSION": "3.10" (line 14). These should be updated to 3.13.7 to match the main Dockerfiles and CI workflow for consistency across all development environments.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants